#include <boost/filesystem/operations.hpp>
#include <iostream>

#include "wcfactory.h"

int main(int argc, char * argv[])
{
    if (argc > 1)
    {
        std::cout << "Input file is " << argv[1] << std::endl;

        WordCounterFactory factory(argv[1]);
        WordCounter * counter = factory.get();
        
        if (counter)
        {
            char c = 'c';
            while (c == 'c')
            {
                std::cout << argv[1] << " has " << counter->count() << " words" << std::endl;
                std::cout << std::endl << "Enter \'c\' to continue. (You can change file before): ";
                std::cin >> c;
            }
            return 0;
        }
        std::cout << "Error! File doesn't exist or is't supported." << std::endl;
        return 1;
    }
    
    std::cout << "You do not enter input file" << std::endl;
    return 2;
}
